package com.web.zsqqimengzhixing.controller;

import com.web.zsqqimengzhixing.pojo.Result;
import com.web.zsqqimengzhixing.pojo.Userprofile;
import com.web.zsqqimengzhixing.service.UserprofileService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequestMapping("/userProfile")
public class UserprofileController {
    @Autowired
    private UserprofileService userprofileService;

    //根据手机号查询个人信息
    @GetMapping("/{mobile}")
    public Result select(@PathVariable String mobile){
        log.info("正在根据手机号查询个人信息，手机号为：{}",mobile);
           Userprofile  userprofile = userprofileService.select(mobile);
              log.info("查询结果为：{}",userprofile);
              return Result.success(userprofile);
    }


}
